<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <h:form id="EstrategiaglobalListForm">
        <p:panel header="ESTRATEGIAS GLOBALES">
            <p:dataTable id="datalist" value="#{estrategiaglobalController.items}" var="item"
                         selectionMode="single" selection="#{estrategiaglobalController.selected}"
                         paginator="true"
                         rowKey="#{item.idEstrategiaGlobal}"
                         rows="10"
                         >

                <p:ajax event="rowSelect"   update="viewButton"/>
                <p:ajax event="rowUnselect" update="viewButton"/>

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="CODIGO"/>
                    </f:facet>
                    <h:outputText value="#{item.idEstrategiaGlobal}"/>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="ESTRATEGIA"/>
                    </f:facet>
                    <h:outputText value="#{item.estrategia}"/>
                </p:column>
                <f:facet name="footer">
                    <p:commandButton style="height: 75px;
                                     width: 75px;
                                     background-image: url(../img/fondo-boton.png);
                                     background-size: 75px;
                                     border-radius: 50px;
                                     color:#ffffff"
                                     id="viewButton" icon="ui-icon-search" title="Ver" update=":EstrategiaglobalViewForm" oncomplete="PF('EstrategiaglobalViewDialog').show()" disabled="#{empty estrategiaglobalController.selected}"/>
                    <p:commandButton style="height: 75px;
                                   width: 75px;
                                   background-image: url(../img/fondo-boton.png);
                                   background-size: 75px;
                                   border-radius: 50px;
                                   color:#ffffff"
                                   icon="ui-icon-print"
                                   ajax="false"
                                   title="Generar Reporte">
                        <p:dataExporter type="pdf" target="datalist" fileName="Estrategias Globales" pageOnly="true"/>
                    </p:commandButton>
                </f:facet>
            </p:dataTable>
        </p:panel>
    </h:form>


    <ui:include src="View.xhtml"/>



</html>
